﻿#pragma once
#include "SiContext.h"
#include "CodeGenerate\BlockGen.h"

class BlockContext : public SiContext
{
public:
	BlockContext(SiContext* parent) : SiContext(parent) {}
	// 通过变量名称查找符号
	virtual CodeGen* findSymbolValue(const std::string& name, bool recursive = true);

	virtual void setSymbolValue(const std::string& name, CodeGen* v);
public:
	static BlockGen* createGen(SiContext * context, std::vector< AstNode* > lines, const std::string& name = std::string());
protected:
	std::unordered_map< std::string, CodeGen* > _symbols;	// 这里是区块的符号表
};
